package com.crazymaker.demo.proxy.basic;

import com.alibaba.fastjson.JSONObject;
import com.crazymaker.springcloud.common.result.RestOut;
import com.crazymaker.springcloud.seckill.remote.client.DemoClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@AllArgsConstructor
@Slf4j
class DemoClientImpl implements DemoClient
{

    //hello简单实现
    public RestOut<JSONObject> hello()
    {
        JSONObject data = new JSONObject();
        data.put("hello", "world" );
        return RestOut.success(data).setRespMsg("操作成功" );
    }

    //echo简单实现
    public RestOut<JSONObject> echo(String word)
    {

        JSONObject data = new JSONObject();
        data.put("echo", word);
        return RestOut.success(data).setRespMsg("操作成功" );
    }

}
